package cn.k23.mapper;

import cn.k23.entity.Carousel;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @Description:
 * @Author: k23
 * @Date: 2022-04-04 9:35
 * @Version: 1.0
 */
@Service
public interface CarouselMapper {
    @Select("select * from t_carousel")
    public List<Carousel> queryAll();

    @Select("select * from t_carousel where isshow")
    public List<Carousel> show();

    @Update("update t_carousel set isshow=#{v} where id = #{id}")
    public int updateIsShow(@Param("v") int v,@Param("id") int id);

    @Delete("delete from t_carousel where id = #{id}")
    public int deleteById(int id);

    @Insert("insert into t_carousel(title,link,src,isshow) value(#{title},#{link},#{src},#{isshow})")
    public int save (Map<String,Object> map);
}
